package com.orhon.smartcampus.modules.baseinfo.mm;


import com.orhon.smartcampus.modules.base.mm.LangMapper;
import com.orhon.smartcampus.modules.baseinfo.entity.SchoolcalendarDay;
import com.orhon.smartcampus.modules.baseinfo.gqlModel.GQLSchoolCalendarDay;

import java.util.List;

import org.mapstruct.InheritConfiguration;
import org.mapstruct.Mapper;
import org.mapstruct.Mapping;
import org.mapstruct.factory.Mappers;

@Mapper(uses = {
        LangMapper.class,
        SemesterMapper.class,
        SchoolCalendarWeekMapper.class
})
public interface SchoolCalendarDayMapper {

    SchoolCalendarDayMapper MAPPER = Mappers.getMapper(SchoolCalendarDayMapper.class);

    @Mapping(source = "id" , target = "id")
    @Mapping(source = "schoolId" , target = "school_id")
    @Mapping(source = "yearCode" , target = "year_code")
    @Mapping(source = "year" , target = "year")
    @Mapping(source = "month" , target = "month")
    @Mapping(source = "day" , target = "day")
    @Mapping(source = "type" , target = "type")
    @Mapping(source = "daySort" , target = "day_sort")
    @Mapping(source = "weekNumber" , target = "week_number")
//    @Mapping(source = "weekId" , target = "week_id")
    @Mapping(source = "name" , target = "name")//lang    
    @Mapping(target = "semester" , ignore = true)
    @Mapping(target = "week" , ignore = true)
    GQLSchoolCalendarDay toSchoolCalendarDay(SchoolcalendarDay entity);
    
    @InheritConfiguration(name = "toSchoolCalendarDay")
    List<GQLSchoolCalendarDay> toSchoolCalendarDayList(List<SchoolcalendarDay> entities);

}
